package resoft.jeasyform.charva;

import charva.awt.*;
import charvax.swing.JComponent;

/**
 * <p></p>
 * User: albert
 * Date: Aug 29, 2007
 * Time: 2:54:29 AM
 */
public class JRectangle extends JComponent {

    
    public void draw() {
        super.draw();
        Point origin = getLocationOnScreen();
//        Insets insets = super.getInsets();
//        origin.translate(insets.left, insets.top);


        
        Toolkit.getDefaultToolkit().drawBoxNative(x,y,x + width,y + height, Color.black.getCursesColor());

        Toolkit term = Toolkit.getDefaultToolkit();

        term.setCursor(origin);
        //super.
    }

    public Dimension getSize() {
        return new Dimension(width,height);//new Dimension(getBounds().getRight() - getBounds().getLeft(),getBounds().getBottom() - getBounds().getTop());
    }

    public int getWidth() {
        return width;//getBounds().getRight() - getBounds().getLeft();
    }

    public int getHeight() {
        return height;//getBounds().getBottom() - getBounds().getTop();
    }

    public Dimension minimumSize() {
        return new Dimension(width,height);
    }

    public void debug(int level_) {

    }


    public void setX(int x) {
        this.x = x;
    }

    public void setY(int y) {
        this.y = y;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    private int x;
    private int y;
    private int width;
    private int height;
}
